/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.model.disc.parametricintegration;

import java.util.ArrayList;

import br.ufmg.dees.insane.model.disc.integrationpoint.GaussPoint;
import br.ufmg.dees.insane.model.disc.integrationpoint.IntegrationPoint;
import br.ufmg.dees.insane.model.disc.shape.H8;

/**
*A class representing the parametric integration for eight nodes hexahedral elements.<p>
*
*@author Lucas, Marcelo & Pitangueira, Roque
*@version 1.0
*@since August 2004
*/

public class PIH8 extends Volume
{
	/** Constructs parametric integration for eight nodes hexahedral element, set its shape to H8, set its type to PIH8.*/
	public PIH8()
	{
		this.setShape(new H8());
		this.setType("PIH8");
		pointForces.clear();
	}
	
//********************************************************************************
	
	/** Return the integration order of this PIH8.
	*@return the integration order of this PIH8.
	*/
	public int getIntegrationOrder()
	{
		return 2;
	}
	
//********************************************************************************
	
	/** Return the integration points of this Equivalent Nodal Load.
	*@return the integration points of this Equivalent Nodal Load.
	*/
	protected ArrayList<IntegrationPoint> getIntegrationPoints()
	{
		ArrayList<IntegrationPoint> integrationPoints = new ArrayList<IntegrationPoint>();
		for(int m = 0; m < (this.getIntegrationOrder()); m++)
		{
			for(int q = 0; q < (this.getIntegrationOrder()); q++)
			{
				for(int r = 0; r < (this.getIntegrationOrder()); r++)
				{
					IntegrationPoint ip = new GaussPoint();
					ip.setCoord1(((this.getIntegrationOrder())-1),m);
					ip.setWeight1(((this.getIntegrationOrder())-1),m);
					ip.setCoord2(((this.getIntegrationOrder())-1),q);
					ip.setWeight2(((this.getIntegrationOrder())-1),q);
					ip.setCoord3(((this.getIntegrationOrder())-1),r);
					ip.setWeight3(((this.getIntegrationOrder())-1),r);
					integrationPoints.add(ip);
				}
			}
		}
		return integrationPoints;
	}
	
//********************************************************************************

}
